<template>
  <div class="">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="标题">
        <el-input v-model="formInline.title" placeholder="标题"></el-input>
      </el-form-item>
      <el-form-item label="作者">
        <el-input v-model="formInline.author" placeholder="作者"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="add">添加</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        title: "",
        author: "",
      },
    };
  },
  mounted() {},
  methods: {
    add() {
      this.$store.commit("add", this.formInline);
    },
  },
  components: {},
};
</script>

<style lang="scss"></style>
